﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using e.Store.Domain;
using e.Store.Model.Entities;
using e.Store.Domain.Repositories;

namespace e.Store.Web.Controllers
{
    public class HomeController : Controller
    {
        //
        // GET: /Home/
        IUnitOfWork _IUWork;

        public HomeController()
        {
            _IUWork = new UnitOfWorkcs();
        }

        public HomeController(IUnitOfWork _IUnit)
        {
            _IUWork = _IUnit;
        }
        public ActionResult Index()
        {
            return View();
        }


        public ActionResult LoadLeftMenu()
        {
            return PartialView("_LeftMenu");
        }

        public ActionResult LoadTopMenu()
        {
            MenuRepository menuRepo = _IUWork.ExtRepositoryFor<MenuRepository>();

            List<Menu> lstMenu = menuRepo.GetAllMenus();

            return PartialView("_TopMenu", lstMenu);
        }


        public ActionResult Dashboard()
        {
            return View();
        }
    }
}
